package netty.c2;

import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.concurrent.TimeUnit;

public class TestEventLoop {
    static Logger logger = LogManager.getLogger("mylog");
    public static void main(String[] args) {
        EventLoopGroup group = new NioEventLoopGroup(2);
        System.out.println(group.next());
        System.out.println(group.next());
        System.out.println(group.next());
        System.out.println(group.next());

        group.next().scheduleAtFixedRate(()->{
            logger.debug("ok");
        }, 0, 1, TimeUnit.SECONDS);
        logger.debug("main");
    }
}
